<template>
  <div>
    <div class="his-host">
      <div class="hd">
        <h4>热门搜索</h4>
      </div>
      <div class="bd">
        <van-tag
          v-for="(item, index) in list"
          :key="index"
          @click="tagClick(item)"
          plain
          type="default"
          >{{ item }}</van-tag
        >
      </div>
    </div>

    <!-- <div class="his-host">
      <div class="hd">
        <h4>历史记录</h4>
        <van-icon name="delete-o" />
      </div>
      <div class="bd">
        <van-tag plain type="default">标签</van-tag>
        <van-tag plain type="default">标签</van-tag>
        <van-tag plain type="default">标签</van-tag>
        <van-tag plain type="default">标签</van-tag>
        <van-tag plain type="default">标签</van-tag>
      </div>
    </div> -->
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: ["岳王庙", "杭州动物园", "雷峰塔"],
    };
  },
  methods: {
    tagClick(val) {
      // console.log(val);
      this.$emit("tagClick",val)
    }
    
  },
};
</script>

<style lang="scss" scoped>
.his-host {
  background-color: #fff;
  padding: 1rem;
  margin-bottom: 0.6rem;
  .hd {
    display: flex;
    justify-content: space-between;
    font-size: 1.1em;
    h4 {
      margin: 0;
    }
    margin-bottom: 0.4rem;
  }
  .van-tag {
    margin: 0.5rem 0.6rem 0 0;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    color: black;
    background-color: #efefef;
  }
  .van-tag--plain::before {
    border: none !important;
  }
}
</style>